home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 11 / CU Amiga Magazine's Super CD-ROM 11 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-06].iso / cucd / programming / oberonv4 / configuration / editkeys.text (.txt) < prev    next >
Oberon Text  |  1996-06-02  |  16KB  |  286 lines

  1. Syntax10.Scn.Fnt
  2. Syntax12i.Scn.Fnt
  3. Syntax10i.Scn.Fnt
  4. ParcElems
  5. Alloc
  6. Syntax12.Scn.Fnt
  7. GreekSyntax12.Scn.Fnt
  8. Math12.Scn.Fnt
  9. FoldElems
  10. StampElems
  11. Alloc
  12. 2 Jun 96
  13. StyleElems
  14. Alloc
  15. paragraph
  16. paragraph2
  17. new page
  18. title
  19. abstract
  20. table
  21. algorithm
  22. program
  23. LineElems
  24. Alloc
  25. 2 Jun 96
  26. Syntax10b.Scn.Fnt
  27. Courier10.Scn.Fnt
  28.     EditKeys.Reset
  29.     EditKeys.Read EditKeys.Text ~
  30. (* for documentation, search for this string: EditKeys 2.0 *)
  31. (* programming mail Internal External Documentation *)
  32. (* set hot_key to ` *)
  33.     \ #245
  34. (*built-in functions*)
  35.     (*taking a parameter*)
  36.     write (^0)    char (^1)    font (^2)    off (^3)    call (^4)    arg (^A)    exec (^B)    param (^C)
  37.     (*no parameter*)
  38.     keep (^5)    pick (^6)    caret (^7)    indent (^8)    freeze (^9)
  39. (*abreviations for built-in function calls*)
  40.     arg0 ("0" arg)    arg1 ("1" arg)    arg2 ("2" arg)    arg3 ("4" arg)
  41.     kwrite (keep write)    pwrite (pick write)
  42. (*some font preset macros*)
  43.     n ("Syntax10.Scn.Fnt" font)    i ("Syntax10i.Scn.Fnt" font)
  44.     m ("Syntax10m.Scn.Fnt" font)     b ("Syntax10b.Scn.Fnt" font)
  45.     n2 ("Syntax12.Scn.Fnt" font)    i2 ("Syntax12i.Scn.Fnt" font)
  46.     m2 ("Syntax12m.Scn.Fnt" font)    b2 ("Syntax12b.Scn.Fnt" font)
  47.     n4 ("Syntax14.Scn.Fnt" font)    i4 ("Syntax14i.Scn.Fnt" font)
  48.     m4 ("Syntax14m.Scn.Fnt" font)    b4 ("Syntax14b.Scn.Fnt" font)
  49.     mono ("Courier10.Scn.Fnt" font)    mono2 ("Courier12.Scn.Fnt" font)
  50.     math2 ("Math12.Scn.Fnt" font)    math4 ("Math14.Scn.Fnt" font)
  51.     bold ("KeyCmds.Bold" call)
  52. (*some template macros for special characters*)
  53.     | ("`" write)    (*enable entry of hotkey character*)
  54.     tab ("9" char)    cr ("13" char)    qt ("34" char)    sp (" " write)
  55.     = (cr indent)    ` (= tab)    del ("127" char)    lf ("10" char)
  56.     a` ("
  57. " pwrite)    a' ("
  58. " pwrite)    a^ ("
  59. " pwrite)    a" ("
  60. " pwrite)    A" ("
  61. " pwrite)
  62.     e` ("
  63. " pwrite)    e' ("
  64. " pwrite)    e^ ("
  65. " pwrite)    e" ("
  66. " pwrite)
  67.     i` ("
  68. " pwrite)    i' ("i'" pwrite)    i^ ("
  69. " pwrite)    i" ("
  70. " pwrite)
  71.     o` ("
  72. " pwrite)    o' ("o'" pwrite)    o^ ("
  73. " pwrite)    o" ("
  74. " pwrite)    O" ("
  75. " pwrite)
  76.     u` ("
  77. " pwrite)    u' ("u'" pwrite)    u^ ("
  78. " pwrite)    u" ("
  79. " pwrite)    U" ("
  80. " pwrite)
  81.     c, ("
  82. " pwrite)    n~ ("
  83. " pwrite)
  84.     alpha ("a" kwrite)    beta ("b" kwrite)    gamma ("g" kwrite)
  85.     delta ("d" kwrite)    epsilon ("e" kwrite)    zeta ("z" kwrite)
  86.     eta ("h" kwrite)    theta ("q" kwrite)    iota ("i" kwrite)
  87.     kappa ("k" kwrite)    lambda ("l" kwrite)    mu ("m" kwrite)
  88.     nu ("n" kwrite)    xi ("x" kwrite)    omikron ("o" kwrite)
  89.     pi ("p" kwrite)    rho ("r" kwrite)    sigma ("s" kwrite)
  90.     tau ("t" kwrite)    ypsilon ("u" kwrite)    phi ("j" kwrite)
  91.     chi ("c" kwrite)    psi ("y" kwrite)    omega ("w" kwrite)
  92.     leq ("#" kwrite)    geq ("3" kwrite)    neq ("9" kwrite)
  93.     approx (";" kwrite)    about ("p" kwrite)
  94.     begc ("h" kwrite)    endc ("i" kwrite)    begf ("j" kwrite)    endf ("k" kwrite)
  95.     empty ("F" kwrite)    reals ("!" kwrite)    nats ("
  96. " kwrite)
  97.     elem ("N" kwrite)    notelem ("O" kwrite)
  98.     subset ("M" kwrite)    truesubset ("L" kwrite)
  99.     dot ("7" kwrite)    cart ("4" kwrite)    power ("C" kwrite)
  100.     union ("H" kwrite)    sect ("G" kwrite)
  101.     not ("X" kwrite)    and ("Y" kwrite)    or ("Z" kwrite)    xor ("E" kwrite)
  102.     impl ("^" kwrite)    equiv (":" kwrite)
  103.     arrow ("." kwrite)    tarrow ("
  104. " kwrite)
  105.     beg ("
  106. " kwrite)    box ("
  107. " kwrite)    end ("
  108. " kwrite)
  109.     all ("R" kwrite)    ex ("S" kwrite)    qed ("U" kwrite)
  110.     forall ("(" write all sp caret sp ")" write)    exists ("(" write ex sp caret sp ")" write)
  111. (*some vertical offset preset macros*)
  112.     sup ("16" off)    sub ("-16" off)    norm ("0" off)
  113.     [ (sup n)    ] (sub n)    / (norm n2)
  114. (*some macros calling Oberon commands*)
  115.     d ("StampElems.Insert" call)
  116.     d1 ("KeyCmds.DateStamp Syntax10.Scn.Fnt" call)
  117.     id ("StampElems.Insert" call)
  118.     id1 ("KeyCmds.DateStamp Syntax10i.Scn.Fnt" call)
  119.     Cn ("EditTools.ChangeStyle ? => ." call)
  120.     Ci ("EditTools.ChangeStyle ? => i" call)
  121.     Cb ("EditTools.ChangeStyle ? => b" call)
  122.     Cm ("EditTools.ChangeStyle ? => m" call)
  123.     C ("EditTools.ChangeSize ? => 10" call)
  124.     C2 ("EditTools.ChangeSize ? => 12" call)
  125.     C4 ("EditTools.ChangeSize ? => 14" call)
  126.     C6 ("EditTools.ChangeSize ? => 16" call)
  127.     inc2 ("EditTools.IncSize 2" call)
  128.     dec2 ("EditTools.IncSize -2" call)
  129.     save (freeze "KeyCmds.Save" call)
  130.     . ("KeyCmds.Paste" call)
  131.     , ("Edit.Recall" call)
  132. (*some macros to support various text elements*)
  133.     parc ("Edit.InsertParc @" call)    style ("StyleElems.Insert" arg0 param call)
  134.     fold ("
  135. " pwrite caret "
  136. " write)
  137.     graph ("GraphicElems.Insert" call)    pict (" PictElems.Insert Grapes.Pict" call)
  138.     table ("TableElems.Insert" call)    kepler ("KeplerElems.Insert" call)
  139.     clock ("ClockElems.Insert" call)    pop ("PopupElems.Insert" arg0 param call)
  140.     man ("IconElems.Insert" call)
  141.     troup (man man man man man man man man man)
  142.     army (troup troup troup troup troup troup troup troup troup)
  143.     line ("LineElems.Insert auto 1" call)    line2 ("LineElems.Insert auto 2" call)
  144.     line4 ("LineElems.Insert auto 4" call)    line6 ("LineElems.Insert auto 6" call)
  145.     dline ("LineElems.Insert auto 1 double" call)    dline2 ("LineElems.Insert auto 2 double" call)
  146.     dline4 ("LineElems.Insert auto 4 double" call)    dline6 ("LineElems.Insert auto 6 double" call)
  147.     tline ("LineElems.Insert tab 1" call)    tline2 ("LineElems.Insert tab 2" call)
  148.     tline4 ("LineElems.Insert tab 4" call)    tline6 ("LineElems.Insert tab 6" call)
  149.     fline ("LineElems.Insert 1" arg0 param call)    fline2 ("LineElems.Insert 2" arg0 param call)
  150.     fline4 ("LineElems.Insert 4" arg0 param call)    fline6 ("LineElems.Insert 6" arg0 param call)
  151.     stamp ("
  152. " write)
  153. (*style element macros*)
  154.     para ("
  155. " write)
  156.     para2 ("
  157. "write)
  158.     newpage ("
  159. " write)
  160.     title ("
  161. " write)
  162.     abstract ("
  163. " write)
  164.     tablepara ("
  165. " write)
  166.     algorithm ("
  167. " write)
  168.     program ("
  169. " write)
  170. (*some template macros for programming purposes*)
  171.     #40 ("    (* " write caret " *) " write)    (* '(' *)
  172.     #41 ("    (** " write caret " **) " write)    (* ')' *)
  173.     (*[ ("    (* " write caret " *) " write)    (* '[' ctab! *)*)
  174.     (*] ("    (** " write caret " **) " write)    (* ']' ctab! *)*)
  175.     < (tab "(*<< " write caret " *) " write)
  176.     << (tab "(*<<*) " write)
  177.     rd(tab "(*<<RD*)" write)
  178.     oj(tab "(*<<OJ*)" write)
  179.     ff(tab "(*<<FF*)" write)
  180.     header ("    (** " write caret " **) 
  181. " write cr cr)
  182.     M ("MODULE " write arg0 write ";    (** your initials here id1" write caret " / 
  183.     IMPORT Texts, Oberon, Log;
  184.     CONST 
  185.     TYPE 
  186.     VAR 
  187.     PROCEDURE Do*;
  188.     BEGIN
  189.     END Do;
  190. END " write arg0 write "." write cr cr arg0 write ".Do" write cr)
  191.     P ("PROCEDURE " write arg0 write caret ";" write =
  192.         "    VAR" write =
  193.         "BEGIN" write `
  194.         "END " write arg0 write ";" write)
  195.     P* ("PROCEDURE " write arg0 write "*" write caret ";" write tab "(**  **) " write =
  196.         "    VAR" write =
  197.         "BEGIN" write `
  198.         "END " write arg0 write ";" write)
  199.     R (arg0 write " = POINTER TO " pwrite arg0 write "Desc;" pwrite =
  200.         arg0 write "Desc = RECORD" pwrite caret =
  201.         "END;" pwrite cr)
  202.     WHILE ("WHILE " write caret " DO" write cr tab cr del "END;" write)
  203.     REPEAT ("REPEAT " write caret cr "UNTIL ;" write)
  204.     CASE ("CASE " write caret " OF" write cr "END;" write)
  205.     LOOP ("LOOP " write lf tab lf del "END;" write)
  206.     min ("PROCEDURE Min(x, y: INTEGER): INTEGER;
  207.     BEGIN IF x < y THEN RETURN x ELSE RETURN y END
  208.     END Min;
  209.     " write)
  210.     max ("PROCEDURE Max(x, y: INTEGER): INTEGER;
  211.     BEGIN IF x > y THEN RETURN x ELSE RETURN y END
  212.     END Max;
  213.     " write)
  214.     int ("INTEGER;" pwrite)    lint ("LONGINT;" pwrite)    boo ("BOOLEAN;" pwrite)    ptr ("= POINTER TO " pwrite)
  215.     arr ("ARRAY " pwrite caret " OF ;" pwrite)
  216.     ret ("RETURN " write)    RETURN ("RETURN" write)
  217.     exit ("EXIT " write)    EXIT ("EXIT" write)
  218.     halt ("HALT(" write caret ")" write)    HALT ("HALT" write)
  219.     assert ("ASSERT(" write caret ")" write)    ASSERT ("ASSERT" write)
  220.      ls ("Log.Str(" pwrite qt caret qt "); " pwrite)    li ("Log.Int(" pwrite caret "); " pwrite)    ll ("Log.Ln; " pwrite)
  221.     *  (freeze bold)
  222. (* shortcuts *)
  223.     => (arg0 write " => " write caret arg0 write)
  224.     -> (=>) - (=>) > (=>)
  225.     decode ("Decoder.Decode " write caret ".Obj" write)
  226.     code ("AsciiCoder.CodeFiles % " write caret "~" write)
  227.     ren ("System.RenameFiles " write caret "~" write)    rename (ren)
  228.     delete ("System.DeleteFiles " write caret "~" write)
  229.     copy ("System.CopyFiles " write caret "~" write)
  230.     bdir ("Backup.Directory" call)
  231.     bread ("Backup.ReadFiles " write caret "~" write)
  232.     bwrite ("Backup.WriteFiles " write caret "~" write)
  233. (* some template macros for e-mail addresses *)
  234.     parc80 ("
  235. " write)
  236.     format80 ("KeyCmds.MarkFocus" call "KeyCmds.ChangeFont Courier10.Scn.Fnt" call
  237.         "EditTools.ToAscii * " call "EditTools.RemoveElems *" call "EditTools.InsertCR 79 *" call)
  238. (*default macro taken when no match found*)
  239.     (*OTHERWISE ("`" pwrite)*)
  240. (*install macro executed after initially loading EditKeys*)
  241.     INSTALL ()
  242. EditKeys 2.0 Documentation    cas  9 May 92 / mh 19 Apr 94
  243. EditKeys.Open ^    open a user viewer with macro facility
  244. EditKeys.SysOpen ^    open a system viewer with macro facility
  245. EditKeys.GetKeyHandler    put EditKeys.KeyHandle into Oberon.Par.frame.handle if Oberon.Par.pos = -42
  246. EditKeys.Upgrade    exchange handle of marked textframe with EditKeys.Handle
  247. "Copy Out Tool" for using EditKeys.
  248. EditKeys.Definitions 
  249. EditKeys.Read EditKeys.Text ~
  250. EditKeys.Reset
  251. EditKeys.GetKeyCode
  252. EditKeys.Definitions opens a viewer and lists all current macro definitions. A selection or a command parameter can be used to restrict the list to definitions with a certain prefix. EditKeys.Read takes a list of files and reads in macro definitions contained therein. If errors are detected, all definitions are deleted. For prototyping macros, it is also possible to have "@" or ":=" as an argument for EditKeys.Read, where @ causes the current selection to be read in, while := takes the text following. (Warning: in both cases the text is parsed to its end.)
  253. Upon module load time, the standard macro definition file "EditKeys.Text" is read in. Also, if a macro "INSTALL" is defined, it is invoked. EditKeys.Reset deletes all current macro definitions, resetting the hotkey to its default.
  254. EditKeys.GetKeyCode helps to find out the codes of certain keys. Within a text supporting macro keys, entering the hot key causes expansion of the macro entered to the left. To avoid ambiguouties, the longest matching macro name is taken. A macro may have zero or more arguments supplied by the user. If no corresponding definition of a macro is found, a second try is made with the standard macro name "OTHERWISE". (EditKeys.Reset defines "OTHERWISE" to write the default hotkey, i.e. "\".)
  255. Syntax of macro definition files for EditKeys.
  256.     MacroFile = [HotKeyDef] {MacroDef}.
  257.     HotKeyDef = '\' KeyName.    -- sets the macro expansion hot key (default is \)
  258.     MacroDef = MacroName '(' { MacroName | TextStretch | Command} ')'.
  259.     MacroName = KeyName
  260.         |   <graphic character except '#"()\^'>  { <graphic character except '()'>  }.
  261.     TextStretch = '"' <formatted text, not containing '"'> '"'.
  262.     KeyName = '#' <hex number>.
  263.     (Comments and arbitrary white space are allowed between any two terminals. Comments may be nested.)
  264. Syntax of macro invocations.
  265.     MacroInvocation = {Argument ":"} MacroName.
  266.     Argument = { <arbitrary graphic character except : and " > } | TextStretch.
  267. Built-in functions.
  268.     Text stretches are pushed on a parameter stack when processed.
  269.     Built-in functions may pop parameter(s) from that stack.
  270.     ^0    pops a parameter and causes textual insertion.
  271.     ^1    pops a parameter and inserts the corresponding ascii character.
  272.     ^2    pops a parameter which must be a font name; presets the named font.
  273.     ^3    pops a parameter which must be an integer; presets the vertical offset (in 1/64th of font height).
  274.     ^4    pops a parameter and tries to call it as an Oberon command.
  275.     ^A    pops a parameter which must be an integer; pushs the nth (0 is leftmost one) macro argument
  276.     ^B    pops a parameter which must be a macro name; invokes the named macro
  277.     ^C    pops a parameter and appends it to the parameters used when calling an Oberon command
  278.     ^5    keeps the font that would have been used w/o macro; presets this font.
  279.     ^6    picks the font that would have been used w/o macro; forces whole macro to this font.
  280.     ^7    presets the caret position.
  281.     ^8    indents the next line according to the last line's indentation.
  282.     ^9    avoids deletion of the macro, neither inserts characters written by the macro.
  283. Remarks.
  284.     When reading in a macro that has been read in before, the new definition replaces the old one.
  285.     Cyclic definitions can be constructed this way; a try to process such a definition is prevented.
  286.